{template 'common/header-gw'}
<ol class="breadcrumb">
	<li><a href="./?refresh"><i class="fa fa-home"></i></a></li>
	<li><a href="{url 'system/welcome'}">系统</a></li>
	<li class="active"><a href="{url 'system/optimize'}">性能优化</a></li>
</ol>
<ul class="nav nav-tabs">
	<li class="active"><a href="{php echo url('system/optimize');}">性能优化</a></li>
</ul>
<div class="clearfix">
	<div class="alert alert-info">
		<i class="fa fa-info-circle"></i> 启用内存优化功能将会大幅度提升程序性能和服务器的负载能力，内存优化功能需要服务器系统以及PHP扩展模块支持<br>
		<i class="fa fa-info-circle"></i> 目前支持的内存优化接口有 Memcache、eAccelerator<br>
		<i class="fa fa-info-circle"></i> 内存接口的主要设置位于 config.php 当中，您可以通过编辑 config.php 进行高级设置<br>
	</div>
	<div class="panel panel-info">
		<div class="panel-heading">当前内存工作状态</div>
		<div class="panel-body table-responsive">
			<table class="table table-hover">
				<thead>
				<tr>
					<th>内存接口</th>
					<th>PHP 扩展环境</th>
					<th>Config 设置</th>
					<th></th>
				</tr>
				</thead>
				<tbody>
				{loop $extensions $key $extension}
				<tr>
					<td><span class="label label-success">{$key}</span></td>
					<td>
						{if $extension['support']}
							支持
						{else}
							不支持
						{/if}
					</td>
					<td>
						{if $extension['status']}
							已开启
						{else}
							未开启
						{/if}
						{if $key == 'opcache' && $extensions['eAccelerator']['status'] && $extensions['opcache']['status']}
						<span class="label label-danger">eAccelerator 不可与 opcache同时开启</span>
						{/if}
					</td>
					<td>
						{if $extension['status'] && $extension['clear']}
						<a href="{$extension['clear']['url']}">{$extension['clear']['title']}</a>
						{/if}
						{$extension['extra']}
					</td>
				</tr>
				{/loop}
				</tbody>
			</table>
		</div>
	</div>
	<div class="panel panel-info">
		<div class="panel-heading">数据库读写分离工作状态</div>
		<div class="panel-body table-responsive">
			<table class="table table-hover">
				<tbody>
				<tr>
					<th width="200">读写分离状态</th>
					<td>
						{if $slave['slave_status']}
						<span class="label label-success">已开启</span>
						{else}
						<span class="label label-danger">未开启</span>
						{/if}
					</td>
				<tr>
					<th>session存储方式</th>
					<td>
						{if $extensions['memcache']['status'] && $setting['memcache']['session'] == 1}
						<span class="label label-danger">memcache</span>
						{else}
						<span class="label label-success">mysql</span>
						{/if}
					</td>
				</tr>
				<tr>
					<th>禁用从数据库的数据表</th>
					<td>
						{if !empty($slave['common']['slave_except_table'])}
							{loop $slave['common']['slave_except_table'] $row}
								{$row}
							{/loop}
						{else}
							暂无
						{/if}
					</td>
				</tr>
				</tbody>
			</table>
		</div>
	</div>
	<div class="panel panel-info">
		<div class="panel-heading">远程访问代理设置</div>
		<div class="panel-body table-responsive">
			<table class="table">
				<tbody>
				<tr>
					<th width="200">状态</th>
					<td>
						{if !empty($setting['proxy']['host'])}
							<span class="label label-success">已开启</span>
						{else}
							<span class="label label-danger">未开启</span>
						{/if}
					</td>
				</tr>
				{if !empty($setting['proxy']['host'])}
				<tr>
					<th>远程地址</th>
					<td>{$setting['proxy']['host']} 因安全原因，密码不予显示</td>
				</tr>
				{/if}
				</tbody>
			</table>
		</div>
	</div>
</div>
{template 'common/footer-gw'}
